package com.lagou.numbersort.step1;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class NumSortMapper extends Mapper<LongWritable, Text,LongWritable, NullWritable> {

    LongWritable k = new LongWritable();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {

        long number = Long.parseLong(value.toString());
        k.set(number);

        context.write(k,NullWritable.get());
    }
}
